(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

cond1(true, x) → cond2(even(x), x)
cond2(true, x) → cond1(neq(x, 0), div2(x))
cond2(false, x) → cond1(neq(x, 0), p(x))
neq(0, 0) → false
neq(0, s(x)) → true
neq(s(x), 0) → true
neq(s(x), s(y)) → neq(x, y)
even(0) → true
even(s(0)) → false
even(s(s(x))) → even(x)
div2(0) → 0
div2(s(0)) → 0
div2(s(s(x))) → s(div2(x))
p(0) → 0
p(s(x)) → x

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

cond1(true, x) → cond2(even(x), x) [1]
cond2(true, x) → cond1(neq(x, 0), div2(x)) [1]
cond2(false, x) → cond1(neq(x, 0), p(x)) [1]
neq(0, 0) → false [1]
neq(0, s(x)) → true [1]
neq(s(x), 0) → true [1]
neq(s(x), s(y)) → neq(x, y) [1]
even(0) → true [1]
even(s(0)) → false [1]
even(s(s(x))) → even(x) [1]
div2(0) → 0 [1]
div2(s(0)) → 0 [1]
div2(s(s(x))) → s(div2(x)) [1]
p(0) → 0 [1]
p(s(x)) → x [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

cond1(true, x) → cond2(even(x), x) [1]
cond2(true, x) → cond1(neq(x, 0), div2(x)) [1]
cond2(false, x) → cond1(neq(x, 0), p(x)) [1]
neq(0, 0) → false [1]
neq(0, s(x)) → true [1]
neq(s(x), 0) → true [1]
neq(s(x), s(y)) → neq(x, y) [1]
even(0) → true [1]
even(s(0)) → false [1]
even(s(s(x))) → even(x) [1]
div2(0) → 0 [1]
div2(s(0)) → 0 [1]
div2(s(s(x))) → s(div2(x)) [1]
p(0) → 0 [1]
p(s(x)) → x [1]

The TRS has the following type information:
cond1 :: true:false → 0:s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0:s:y → cond1:cond2
even :: 0:s:y → true:false
neq :: 0:s:y → 0:s:y → true:false
0 :: 0:s:y
div2 :: 0:s:y → 0:s:y
false :: true:false
p :: 0:s:y → 0:s:y
s :: 0:s:y → 0:s:y
y :: 0:s:y

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added:

cond1(v0, v1) → null_cond1 [0]
neq(v0, v1) → null_neq [0]
even(v0) → null_even [0]
div2(v0) → null_div2 [0]
p(v0) → null_p [0]
cond2(v0, v1) → null_cond2 [0]

And the following fresh constants:

null_cond1, null_neq, null_even, null_div2, null_p, null_cond2

(6) Obligation:

Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

cond1(true, x) → cond2(even(x), x) [1]
cond2(true, x) → cond1(neq(x, 0), div2(x)) [1]
cond2(false, x) → cond1(neq(x, 0), p(x)) [1]
neq(0, 0) → false [1]
neq(0, s(x)) → true [1]
neq(s(x), 0) → true [1]
neq(s(x), s(y)) → neq(x, y) [1]
even(0) → true [1]
even(s(0)) → false [1]
even(s(s(x))) → even(x) [1]
div2(0) → 0 [1]
div2(s(0)) → 0 [1]
div2(s(s(x))) → s(div2(x)) [1]
p(0) → 0 [1]
p(s(x)) → x [1]
cond1(v0, v1) → null_cond1 [0]
neq(v0, v1) → null_neq [0]
even(v0) → null_even [0]
div2(v0) → null_div2 [0]
p(v0) → null_p [0]
cond2(v0, v1) → null_cond2 [0]

The TRS has the following type information:
cond1 :: true:false:null_neq:null_even → 0:s:y:null_div2:null_p → null_cond1:null_cond2
true :: true:false:null_neq:null_even
cond2 :: true:false:null_neq:null_even → 0:s:y:null_div2:null_p → null_cond1:null_cond2
even :: 0:s:y:null_div2:null_p → true:false:null_neq:null_even
neq :: 0:s:y:null_div2:null_p → 0:s:y:null_div2:null_p → true:false:null_neq:null_even
0 :: 0:s:y:null_div2:null_p
div2 :: 0:s:y:null_div2:null_p → 0:s:y:null_div2:null_p
false :: true:false:null_neq:null_even
p :: 0:s:y:null_div2:null_p → 0:s:y:null_div2:null_p
s :: 0:s:y:null_div2:null_p → 0:s:y:null_div2:null_p
y :: 0:s:y:null_div2:null_p
null_cond1 :: null_cond1:null_cond2
null_neq :: true:false:null_neq:null_even
null_even :: true:false:null_neq:null_even
null_div2 :: 0:s:y:null_div2:null_p
null_p :: 0:s:y:null_div2:null_p
null_cond2 :: null_cond1:null_cond2

Rewrite Strategy: INNERMOST

(7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

true => 2
0 => 0
false => 1
y => 1
null_cond1 => 0
null_neq => 0
null_even => 0
null_div2 => 0
null_p => 0
null_cond2 => 0

(8) Obligation:

Complexity RNTS consisting of the following rules:

cond1(z, z') -{ 1 }→ cond2(even(x), x) :|: z = 2, z' = x, x >= 0
cond1(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
cond2(z, z') -{ 1 }→ cond1(neq(x, 0), p(x)) :|: z' = x, z = 1, x >= 0
cond2(z, z') -{ 1 }→ cond1(neq(x, 0), div2(x)) :|: z = 2, z' = x, x >= 0
cond2(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
div2(z) -{ 1 }→ 0 :|: z = 0
div2(z) -{ 1 }→ 0 :|: z = 1 + 0
div2(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0
div2(z) -{ 1 }→ 1 + div2(x) :|: x >= 0, z = 1 + (1 + x)
even(z) -{ 1 }→ even(x) :|: x >= 0, z = 1 + (1 + x)
even(z) -{ 1 }→ 2 :|: z = 0
even(z) -{ 1 }→ 1 :|: z = 1 + 0
even(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0
neq(z, z') -{ 1 }→ neq(x, 1) :|: z' = 1 + 1, x >= 0, z = 1 + x
neq(z, z') -{ 1 }→ 2 :|: z' = 1 + x, x >= 0, z = 0
neq(z, z') -{ 1 }→ 2 :|: x >= 0, z = 1 + x, z' = 0
neq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
neq(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
p(z) -{ 1 }→ x :|: x >= 0, z = 1 + x
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0

Only complete derivations are relevant for the runtime complexity.

(9) CompleteCoflocoProof (EQUIVALENT transformation)

Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo:

eq(start(V, V1),0,[cond1(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1),0,[cond2(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1),0,[neq(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1),0,[even(V, Out)],[V >= 0]).
eq(start(V, V1),0,[div2(V, Out)],[V >= 0]).
eq(start(V, V1),0,[p(V, Out)],[V >= 0]).
eq(cond1(V, V1, Out),1,[even(V2, Ret0),cond2(Ret0, V2, Ret)],[Out = Ret,V = 2,V1 = V2,V2 >= 0]).
eq(cond2(V, V1, Out),1,[neq(V3, 0, Ret01),div2(V3, Ret1),cond1(Ret01, Ret1, Ret2)],[Out = Ret2,V = 2,V1 = V3,V3 >= 0]).
eq(cond2(V, V1, Out),1,[neq(V4, 0, Ret02),p(V4, Ret11),cond1(Ret02, Ret11, Ret3)],[Out = Ret3,V1 = V4,V = 1,V4 >= 0]).
eq(neq(V, V1, Out),1,[],[Out = 1,V = 0,V1 = 0]).
eq(neq(V, V1, Out),1,[],[Out = 2,V1 = 1 + V5,V5 >= 0,V = 0]).
eq(neq(V, V1, Out),1,[],[Out = 2,V6 >= 0,V = 1 + V6,V1 = 0]).
eq(neq(V, V1, Out),1,[neq(V7, 1, Ret4)],[Out = Ret4,V1 = 2,V7 >= 0,V = 1 + V7]).
eq(even(V, Out),1,[],[Out = 2,V = 0]).
eq(even(V, Out),1,[],[Out = 1,V = 1]).
eq(even(V, Out),1,[even(V8, Ret5)],[Out = Ret5,V8 >= 0,V = 2 + V8]).
eq(div2(V, Out),1,[],[Out = 0,V = 0]).
eq(div2(V, Out),1,[],[Out = 0,V = 1]).
eq(div2(V, Out),1,[div2(V9, Ret12)],[Out = 1 + Ret12,V9 >= 0,V = 2 + V9]).
eq(p(V, Out),1,[],[Out = 0,V = 0]).
eq(p(V, Out),1,[],[Out = V10,V10 >= 0,V = 1 + V10]).
eq(cond1(V, V1, Out),0,[],[Out = 0,V11 >= 0,V12 >= 0,V = V11,V1 = V12]).
eq(neq(V, V1, Out),0,[],[Out = 0,V13 >= 0,V14 >= 0,V = V13,V1 = V14]).
eq(even(V, Out),0,[],[Out = 0,V15 >= 0,V = V15]).
eq(div2(V, Out),0,[],[Out = 0,V16 >= 0,V = V16]).
eq(p(V, Out),0,[],[Out = 0,V17 >= 0,V = V17]).
eq(cond2(V, V1, Out),0,[],[Out = 0,V18 >= 0,V19 >= 0,V = V18,V1 = V19]).
input_output_vars(cond1(V,V1,Out),[V,V1],[Out]).
input_output_vars(cond2(V,V1,Out),[V,V1],[Out]).
input_output_vars(neq(V,V1,Out),[V,V1],[Out]).
input_output_vars(even(V,Out),[V],[Out]).
input_output_vars(div2(V,Out),[V],[Out]).
input_output_vars(p(V,Out),[V],[Out]).

CoFloCo proof output:
Preprocessing Cost Relations
=====================================

#### Computed strongly connected components
0. recursive : [div2/2]
1. recursive : [neq/3]
2. non_recursive : [p/2]
3. recursive : [even/2]
4. recursive : [cond1/3,cond2/3]
5. non_recursive : [start/2]

#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into div2/2
1. SCC is partially evaluated into neq/3
2. SCC is partially evaluated into p/2
3. SCC is partially evaluated into even/2
4. SCC is partially evaluated into cond2/3
5. SCC is partially evaluated into start/2

Control-Flow Refinement of Cost Relations
=====================================

### Specialization of cost equations div2/2
* CE 24 is refined into CE [30]
* CE 23 is refined into CE [31]
* CE 26 is refined into CE [32]
* CE 25 is refined into CE [33]


### Cost equations --> "Loop" of div2/2
* CEs [33] --> Loop 20
* CEs [30] --> Loop 21
* CEs [31,32] --> Loop 22

### Ranking functions of CR div2(V,Out)
* RF of phase [20]: [V-1]

#### Partial ranking functions of CR div2(V,Out)
* Partial RF of phase [20]:
- RF of loop [20:1]:
V-1


### Specialization of cost equations neq/3
* CE 22 is refined into CE [34]
* CE 20 is refined into CE [35]
* CE 19 is refined into CE [36]
* CE 18 is refined into CE [37]
* CE 21 is refined into CE [38]


### Cost equations --> "Loop" of neq/3
* CEs [38] --> Loop 23
* CEs [34] --> Loop 24
* CEs [35] --> Loop 25
* CEs [36] --> Loop 26
* CEs [37] --> Loop 27

### Ranking functions of CR neq(V,V1,Out)

#### Partial ranking functions of CR neq(V,V1,Out)


### Specialization of cost equations p/2
* CE 28 is refined into CE [39]
* CE 27 is refined into CE [40]
* CE 29 is refined into CE [41]


### Cost equations --> "Loop" of p/2
* CEs [39] --> Loop 28
* CEs [40,41] --> Loop 29

### Ranking functions of CR p(V,Out)

#### Partial ranking functions of CR p(V,Out)


### Specialization of cost equations even/2
* CE 12 is refined into CE [42]
* CE 10 is refined into CE [43]
* CE 9 is refined into CE [44]
* CE 11 is refined into CE [45]


### Cost equations --> "Loop" of even/2
* CEs [45] --> Loop 30
* CEs [42] --> Loop 31
* CEs [43] --> Loop 32
* CEs [44] --> Loop 33

### Ranking functions of CR even(V,Out)
* RF of phase [30]: [V-1]

#### Partial ranking functions of CR even(V,Out)
* Partial RF of phase [30]:
- RF of loop [30:1]:
V-1


### Specialization of cost equations cond2/3
* CE 14 is refined into CE [46,47,48,49,50]
* CE 13 is refined into CE [51,52,53,54,55]
* CE 17 is refined into CE [56]
* CE 16 is refined into CE [57,58,59,60,61,62]
* CE 15 is refined into CE [63,64,65,66,67,68,69]


### Cost equations --> "Loop" of cond2/3
* CEs [62] --> Loop 34
* CEs [57] --> Loop 35
* CEs [61] --> Loop 36
* CEs [59] --> Loop 37
* CEs [60] --> Loop 38
* CEs [58] --> Loop 39
* CEs [69] --> Loop 40
* CEs [68] --> Loop 41
* CEs [67] --> Loop 42
* CEs [64] --> Loop 43
* CEs [66] --> Loop 44
* CEs [63,65] --> Loop 45
* CEs [46,47,48,49,50] --> Loop 46
* CEs [51,52,53,54,55,56] --> Loop 47

### Ranking functions of CR cond2(V,V1,Out)
* RF of phase [34,36,40,41]: [-2*V+V1+1,-V+V1-1,V1-2]

#### Partial ranking functions of CR cond2(V,V1,Out)
* Partial RF of phase [34,36,40,41]:
- RF of loop [34:1,41:1]:
V1-3
- RF of loop [36:1]:
V-1 depends on loops [40:1]
V1/3-5/3
- RF of loop [40:1]:
-V+2 depends on loops [36:1]
V1-2


### Specialization of cost equations start/2
* CE 2 is refined into CE [70]
* CE 3 is refined into CE [71,72,73,74,75,76,77,78,79]
* CE 4 is refined into CE [80,81,82]
* CE 5 is refined into CE [83,84,85,86,87]
* CE 6 is refined into CE [88,89,90,91,92]
* CE 7 is refined into CE [93,94]
* CE 8 is refined into CE [95,96]


### Cost equations --> "Loop" of start/2
* CEs [82] --> Loop 48
* CEs [86] --> Loop 49
* CEs [73] --> Loop 50
* CEs [71,72,74,75,76,77,78,79,81] --> Loop 51
* CEs [85,89] --> Loop 52
* CEs [70,80,83,84,87,88,90,91,92,93,94,95,96] --> Loop 53

### Ranking functions of CR start(V,V1)

#### Partial ranking functions of CR start(V,V1)


Computing Bounds
=====================================

#### Cost of chains of div2(V,Out):
* Chain [[20],22]: 1*it(20)+1
Such that:it(20) =< 2*Out

with precondition: [Out>=1,V>=2*Out]

* Chain [[20],21]: 1*it(20)+1
Such that:it(20) =< 2*Out

with precondition: [V=2*Out+1,V>=3]

* Chain [22]: 1
with precondition: [Out=0,V>=0]

* Chain [21]: 1
with precondition: [V=1,Out=0]


#### Cost of chains of neq(V,V1,Out):
* Chain [27]: 1
with precondition: [V=0,V1=0,Out=1]

* Chain [26]: 1
with precondition: [V=0,Out=2,V1>=1]

* Chain [25]: 1
with precondition: [V1=0,Out=2,V>=1]

* Chain [24]: 0
with precondition: [Out=0,V>=0,V1>=0]

* Chain [23,26]: 2
with precondition: [V=1,V1=2,Out=2]

* Chain [23,24]: 1
with precondition: [V1=2,Out=0,V>=1]


#### Cost of chains of p(V,Out):
* Chain [29]: 1
with precondition: [Out=0,V>=0]

* Chain [28]: 1
with precondition: [V=Out+1,V>=1]


#### Cost of chains of even(V,Out):
* Chain [[30],33]: 1*it(30)+1
Such that:it(30) =< V

with precondition: [Out=2,V>=2]

* Chain [[30],32]: 1*it(30)+1
Such that:it(30) =< V

with precondition: [Out=1,V>=3]

* Chain [[30],31]: 1*it(30)+0
Such that:it(30) =< V

with precondition: [Out=0,V>=2]

* Chain [33]: 1
with precondition: [V=0,Out=2]

* Chain [32]: 1
with precondition: [V=1,Out=1]

* Chain [31]: 0
with precondition: [Out=0,V>=0]


#### Cost of chains of cond2(V,V1,Out):
* Chain [[34,36,40,41],47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+3
Such that:aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(16) =< -V+V1
aux(17) =< V1
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(16)
it(36) =< aux(16)
it(34) =< aux(17)
it(36) =< aux(17)
s(21) =< aux(17)
aux(9) =< aux(17)
s(22) =< aux(17)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(17)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],46]: 20*it(34)+4*s(20)+6*s(21)+1*s(26)+1*s(27)+3
Such that:aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+4
aux(12) =< -V+V1
aux(13) =< -V+V1+2
aux(19) =< V1
it(34) =< aux(19)
s(21) =< aux(19)
it(34) =< aux(10)
it(34) =< aux(11)
it(34) =< aux(12)
it(34) =< aux(13)
aux(9) =< aux(19)
s(22) =< aux(19)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(19)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],45,47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+8
Such that:aux(11) =< -2*V+V1
aux(10) =< -2*V+V1+1
it(36) =< V1/3
aux(20) =< -V+V1
aux(21) =< V1
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(20)
it(36) =< aux(20)
it(34) =< aux(21)
it(36) =< aux(21)
s(21) =< aux(21)
aux(9) =< aux(21)
s(22) =< aux(21)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(21)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=2*V+2]

* Chain [[34,36,40,41],45,46]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+8
Such that:aux(11) =< -2*V+V1
aux(10) =< -2*V+V1+1
it(36) =< V1/3
aux(22) =< -V+V1
aux(23) =< V1
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(22)
it(36) =< aux(22)
it(34) =< aux(23)
it(36) =< aux(23)
s(21) =< aux(23)
aux(9) =< aux(23)
s(22) =< aux(23)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(23)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=2*V+2]

* Chain [[34,36,40,41],43,47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+7
Such that:aux(11) =< -2*V+V1
aux(10) =< -2*V+V1+1
it(36) =< V1/3
aux(24) =< -V+V1
aux(25) =< V1
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(24)
it(36) =< aux(24)
it(34) =< aux(25)
it(36) =< aux(25)
s(21) =< aux(25)
aux(9) =< aux(25)
s(22) =< aux(25)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(25)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=2*V+2]

* Chain [[34,36,40,41],42,47]: 20*it(34)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+1*s(33)+7
Such that:aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
aux(12) =< -V+V1
aux(26) =< -V+V1+1
aux(27) =< V1
s(33) =< aux(26)
it(34) =< aux(27)
it(34) =< aux(10)
it(34) =< aux(11)
it(34) =< aux(12)
it(34) =< aux(26)
s(21) =< aux(27)
aux(9) =< aux(27)
s(22) =< aux(27)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(27)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=2*V+2]

* Chain [[34,36,40,41],39,47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+7
Such that:aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(28) =< -V+V1
aux(29) =< V1
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(28)
it(36) =< aux(28)
it(34) =< aux(29)
it(36) =< aux(29)
s(21) =< aux(29)
aux(9) =< aux(29)
s(22) =< aux(29)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(29)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],38,47]: 20*it(34)+4*s(20)+4*s(21)+1*s(26)+1*s(27)+1*s(37)+7
Such that:aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+4
aux(12) =< -V+V1
aux(30) =< -V+V1+2
aux(31) =< V1
s(37) =< aux(30)
it(34) =< aux(31)
s(21) =< aux(31)
it(34) =< aux(10)
it(34) =< aux(11)
it(34) =< aux(12)
it(34) =< aux(30)
aux(9) =< aux(31)
s(22) =< aux(31)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(31)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],37,47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+2*s(39)+8
Such that:s(38) =< 2
aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(32) =< -V+V1
aux(33) =< V1
s(39) =< s(38)
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(32)
it(36) =< aux(32)
it(34) =< aux(33)
it(36) =< aux(33)
s(21) =< aux(33)
aux(9) =< aux(33)
s(22) =< aux(33)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(33)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],37,45,47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+2*s(39)+13
Such that:s(38) =< 2
aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(34) =< -V+V1
aux(35) =< V1
s(39) =< s(38)
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(34)
it(36) =< aux(34)
it(34) =< aux(35)
it(36) =< aux(35)
s(21) =< aux(35)
aux(9) =< aux(35)
s(22) =< aux(35)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(35)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],37,45,46]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+2*s(39)+13
Such that:s(38) =< 2
aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(36) =< -V+V1
aux(37) =< V1
s(39) =< s(38)
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(36)
it(36) =< aux(36)
it(34) =< aux(37)
it(36) =< aux(37)
s(21) =< aux(37)
aux(9) =< aux(37)
s(22) =< aux(37)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(37)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],37,43,47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+2*s(39)+12
Such that:s(38) =< 2
aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(38) =< -V+V1
aux(39) =< V1
s(39) =< s(38)
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(38)
it(36) =< aux(38)
it(34) =< aux(39)
it(36) =< aux(39)
s(21) =< aux(39)
aux(9) =< aux(39)
s(22) =< aux(39)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(39)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],37,42,47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+1*s(33)+2*s(39)+12
Such that:s(33) =< 1
s(38) =< 2
aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(40) =< -V+V1
aux(41) =< V1
s(39) =< s(38)
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(40)
it(36) =< aux(40)
it(34) =< aux(41)
it(36) =< aux(41)
s(21) =< aux(41)
aux(9) =< aux(41)
s(22) =< aux(41)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(41)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],35,47]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+8
Such that:aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(42) =< -V+V1
aux(43) =< V1
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(42)
it(36) =< aux(42)
it(34) =< aux(43)
it(36) =< aux(43)
s(21) =< aux(43)
aux(9) =< aux(43)
s(22) =< aux(43)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(43)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [[34,36,40,41],35,46]: 15*it(34)+5*it(36)+4*s(20)+2*s(21)+1*s(26)+1*s(27)+8
Such that:aux(10) =< -2*V+V1+1
aux(11) =< -2*V+V1+2
it(36) =< V1/3
aux(44) =< -V+V1
aux(45) =< V1
it(34) =< aux(10)
it(36) =< aux(10)
it(34) =< aux(11)
it(36) =< aux(11)
it(34) =< aux(44)
it(36) =< aux(44)
it(34) =< aux(45)
it(36) =< aux(45)
s(21) =< aux(45)
aux(9) =< aux(45)
s(22) =< aux(45)*2
s(27) =< it(34)*aux(9)
s(26) =< it(34)*aux(45)
s(20) =< s(22)

with precondition: [Out=0,2>=V,V>=1,V1>=V+2]

* Chain [47]: 3
with precondition: [Out=0,V>=0,V1>=0]

* Chain [46]: 4*s(29)+3
Such that:aux(18) =< V1
s(29) =< aux(18)

with precondition: [V=2,Out=0,V1>=0]

* Chain [45,47]: 8
with precondition: [V=1,Out=0,V1>=1]

* Chain [45,46]: 8
with precondition: [V=1,Out=0,V1>=1]

* Chain [44,47]: 8
with precondition: [V=1,V1=2,Out=0]

* Chain [44,45,47]: 13
with precondition: [V=1,V1=2,Out=0]

* Chain [44,45,46]: 13
with precondition: [V=1,V1=2,Out=0]

* Chain [44,43,47]: 12
with precondition: [V=1,V1=2,Out=0]

* Chain [44,42,47]: 1*s(33)+12
Such that:s(33) =< 1

with precondition: [V=1,V1=2,Out=0]

* Chain [43,47]: 7
with precondition: [V=1,Out=0,V1>=1]

* Chain [42,47]: 1*s(33)+7
Such that:s(33) =< V1

with precondition: [V=1,Out=0,V1>=1]

* Chain [39,47]: 7
with precondition: [V=2,Out=0,V1>=1]

* Chain [38,47]: 2*s(36)+1*s(37)+7
Such that:s(35) =< V1
s(37) =< V1/2
s(36) =< s(35)

with precondition: [V=2,Out=0,V1>=2]

* Chain [37,47]: 2*s(39)+8
Such that:s(38) =< 2
s(39) =< s(38)

with precondition: [V=2,Out=0,V1>=2]

* Chain [37,45,47]: 2*s(39)+13
Such that:s(38) =< 2
s(39) =< s(38)

with precondition: [V=2,Out=0,V1>=2]

* Chain [37,45,46]: 2*s(39)+13
Such that:s(38) =< 2
s(39) =< s(38)

with precondition: [V=2,Out=0,V1>=2]

* Chain [37,43,47]: 2*s(39)+12
Such that:s(38) =< 2
s(39) =< s(38)

with precondition: [V=2,Out=0,V1>=2]

* Chain [37,42,47]: 1*s(33)+2*s(39)+12
Such that:s(33) =< 1
s(38) =< 2
s(39) =< s(38)

with precondition: [V=2,Out=0,V1>=2]

* Chain [35,47]: 8
with precondition: [V=2,Out=0,V1>=1]

* Chain [35,46]: 8
with precondition: [V=2,Out=0,V1>=1]


#### Cost of chains of start(V,V1):
* Chain [53]: 1*s(251)+1*s(252)+5*s(253)+13
Such that:s(251) =< 1
s(252) =< V1
aux(57) =< V
s(253) =< aux(57)

with precondition: [V>=0]

* Chain [52]: 2
with precondition: [V=1]

* Chain [51]: 9*s(258)+50*s(264)+536*s(266)+120*s(284)+28*s(291)+28*s(292)+120*s(293)+1*s(297)+40*s(298)+2*s(299)+2*s(300)+2*s(310)+15
Such that:s(281) =< V1+1
s(279) =< V1+2
aux(65) =< 1
aux(66) =< 2
aux(67) =< V1
aux(68) =< V1/2
aux(69) =< V1/3
s(258) =< aux(65)
s(310) =< aux(68)
s(264) =< aux(66)
s(266) =< aux(67)
s(284) =< aux(69)
s(284) =< aux(67)
s(289) =< aux(67)
s(290) =< aux(67)*2
s(291) =< s(266)*s(289)
s(292) =< s(266)*aux(67)
s(293) =< s(290)
s(297) =< s(281)
s(298) =< aux(67)
s(298) =< s(279)
s(298) =< s(281)
s(299) =< s(298)*s(289)
s(300) =< s(298)*aux(67)

with precondition: [V=2,V1>=0]

* Chain [50]: 2*s(354)+15
Such that:aux(70) =< 1
s(354) =< aux(70)

with precondition: [V=2,V1=1]

* Chain [49]: 1
with precondition: [V1=0,V>=1]

* Chain [48]: 1*s(356)+45*s(367)+15*s(368)+10*s(369)+135*s(370)+36*s(371)+9*s(374)+9*s(375)+60*s(376)+45*s(377)+3*s(378)+3*s(379)+1*s(380)+40*s(381)+2*s(382)+2*s(383)+1*s(384)+20*s(385)+1*s(386)+1*s(387)+13
Such that:s(356) =< 1
s(358) =< 2
s(359) =< -2*V+V1
s(360) =< -2*V+V1+1
s(361) =< -2*V+V1+2
s(362) =< -2*V+V1+4
s(363) =< -V+V1
s(357) =< -V+V1+1
s(364) =< -V+V1+2
s(365) =< V1
s(366) =< V1/3
s(367) =< s(366)
s(368) =< s(366)
s(369) =< s(358)
s(370) =< s(360)
s(367) =< s(360)
s(370) =< s(361)
s(367) =< s(361)
s(370) =< s(363)
s(367) =< s(363)
s(370) =< s(365)
s(367) =< s(365)
s(371) =< s(365)
s(372) =< s(365)
s(373) =< s(365)*2
s(374) =< s(370)*s(372)
s(375) =< s(370)*s(365)
s(376) =< s(373)
s(377) =< s(360)
s(368) =< s(360)
s(377) =< s(359)
s(368) =< s(359)
s(377) =< s(363)
s(368) =< s(363)
s(377) =< s(365)
s(368) =< s(365)
s(378) =< s(377)*s(372)
s(379) =< s(377)*s(365)
s(380) =< s(364)
s(381) =< s(365)
s(381) =< s(360)
s(381) =< s(362)
s(381) =< s(363)
s(381) =< s(364)
s(382) =< s(381)*s(372)
s(383) =< s(381)*s(365)
s(384) =< s(357)
s(385) =< s(365)
s(385) =< s(360)
s(385) =< s(361)
s(385) =< s(363)
s(385) =< s(357)
s(386) =< s(385)*s(372)
s(387) =< s(385)*s(365)

with precondition: [2>=V,V>=1,V1>=V+2]


Closed-form bounds of start(V,V1):
-------------------------------------
* Chain [53] with precondition: [V>=0]
- Upper bound: 5*V+14+nat(V1)
- Complexity: n
* Chain [52] with precondition: [V=1]
- Upper bound: 2
- Complexity: constant
* Chain [51] with precondition: [V=2,V1>=0]
- Upper bound: 816*V1+124+60*V1*V1+ (V1+1)+V1+40*V1
- Complexity: n^2
* Chain [50] with precondition: [V=2,V1=1]
- Upper bound: 17
- Complexity: constant
* Chain [49] with precondition: [V1=0,V>=1]
- Upper bound: 1
- Complexity: constant
* Chain [48] with precondition: [2>=V,V>=1,V1>=V+2]
- Upper bound: 216*V1+34+6*V1*V1+ (-2*V+V1+1)* (24*V1)+ (-V+V1+1)+ (-V+V1+2)+ (-360*V+180*V1+180)+20*V1
- Complexity: n^2

### Maximum cost of start(V,V1): max([16,nat(V1)+13+max([5*V,nat(V1)*215+20+nat(V1)*6*nat(V1)+nat(V1/3)*60+max([nat(V1)*24*nat(-2*V+V1+1)+nat(-V+V1+1)+nat(-V+V1+2)+nat(-2*V+V1+1)*180,nat(V1)*600+90+nat(V1)*54*nat(V1)+nat(V1+1)+nat(V1/2)*2+nat(V1/3)*60])])])+1
Asymptotic class: n^2
* Total analysis performed in 1081 ms.

(10) BOUNDS(1, n^2)